
package com.liao.badminton.controller;

import com.liao.badminton.code.*;
import com.liao.badminton.dto.SystemLoginLogDto;
import com.liao.badminton.vo.SystemLoginLogVo;
import com.github.pagehelper.PageInfo;
import com.liao.badminton.service.SystemLoginLogService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import com.liao.badminton.code.validation.FindDetail;
import org.springframework.validation.annotation.Validated;
/**
* @author liaocheng
* @date 2024-12-23
* description:用户登录日志
*/
@RestController
@RequestMapping(value = "/systemLoginLog")
//@PreAuthorize("@ss.hasPermission('systemLoginLog')")//权限管理;
public class SystemLoginLogController {

  //  private static  Logger logger= LoggerFactory.getLogger(SystemLoginLogController.class);

    @Autowired
    private SystemLoginLogService systemLoginLogService;




    /**
    * 新增systemLoginLog
    */
    @RequestMapping(value = "/add")
    @PreAuthorize("@ss.hasPermission('systemLoginLog:add')")//权限管理;
    public ResponseRest<Long> add(@RequestBody @Validated(Insert.class) SystemLoginLogDto systemLoginLog)throws ProjectException{
        return ResponseRest.suc("saveSystemLoginLog", systemLoginLogService.saveSystemLoginLog(systemLoginLog));
    }
    /**
    * 批量删除
    */
    @RequestMapping(value = "/deletes")
    @PreAuthorize("@ss.hasPermission('systemLoginLog:deletes')")//权限管理;
    public ResponseRest<Boolean> deletes(@RequestBody @Validated(Delete.class) SystemLoginLogDto param)throws ProjectException{
        return systemLoginLogService.deletesSystemLoginLog(param);
    }
    /**
    * 修改systemLoginLog
    */
    @RequestMapping(value = "/update")
    @PreAuthorize("@ss.hasPermission('systemLoginLog:update')")//权限管理;
    public ResponseRest<Boolean> update(@RequestBody @Validated(Update.class) SystemLoginLogDto param)throws ProjectException{
        return systemLoginLogService.updateSystemLoginLog(param);
    }

    @RequestMapping(value = "/findDetail")
    @PreAuthorize("@ss.hasPermission('SystemLoginLog:findDetail')")//权限管理;
    public ResponseRest<SystemLoginLogVo> findDetail(@RequestBody @Validated(FindDetail.class) SystemLoginLogDto param) throws ProjectException {
      return systemLoginLogService.findDetail(param);
    }
    /**
    * 分页查询列表
    */
    @RequestMapping(value = "/list")
    @PreAuthorize("@ss.hasPermission('systemLoginLog:list')")//权限管理;
    public ResponseRest<PageInfo<SystemLoginLogVo>> list(@RequestBody PageParam<SystemLoginLogDto> body) throws ProjectException{
      return   systemLoginLogService.findSystemLoginLogByPageParam(body);
    }

}
